inherited frmSaleOrderBill: TfrmSaleOrderBill
  Left = 480
  Top = 89
  Caption = #38144#21806#35746#21333
  PixelsPerInch = 96
  TextHeight = 12
  inherited pnlDBCtrl: TPanel
    object Shape: TShape [0]
      Left = 285
      Top = -1
      Width = 93
      Height = 36
      Anchors = [akTop, akRight]
      Brush.Color = 16773345
      Pen.Color = clRed
      Pen.Style = psInsideFrame
      Pen.Width = 2
      Shape = stEllipse
    end
    object FinishedLabel: TLabel [1]
      Left = 300
      Top = 7
      Width = 66
      Height = 21
      Anchors = [akTop, akRight]
      Caption = #24050#23436#25104
      Font.Charset = GB2312_CHARSET
      Font.Color = clBlue
      Font.Height = -21
      Font.Name = #23435#20307
      Font.Style = [fsBold]
      ParentFont = False
      Transparent = True
    end
    inherited pnlThirdtrade: TPanel
      inherited lblTTtraderid: TcxLabel
        AnchorX = 78
      end
      inherited cxLabel1: TcxLabel
        Left = 216
        ExplicitLeft = 216
        AnchorX = 244
      end
      inherited lblTTBalanceid: TcxLabel
        Left = 381
        ExplicitLeft = 381
        AnchorX = 433
      end
    end
    inherited DtlPageCtrl: TcxPageControl
      inherited tabMain: TcxTabSheet
        inherited DtlGrid: TcxGrid
          inherited DtlGridDBTableView: TcxGridDBBandedTableView
            inherited colProductid: TcxGridDBBandedColumn
              Width = 41
            end
            inherited colUnitname: TcxGridDBBandedColumn
              Width = 28
            end
            inherited colQuantity: TcxGridDBBandedColumn
              Width = 42
            end
          end
        end
      end
      inherited tsSum: TcxTabSheet
        ExplicitWidth = 872
        ExplicitHeight = 258
      end
    end
    inherited imgCheck: TcxImage
      Left = 76
      Top = 4
      TabOrder = 0
      ExplicitLeft = 76
      ExplicitTop = 4
    end
    inherited imgAbate: TcxImage
      Left = 164
      Top = 12
      TabOrder = 6
      ExplicitLeft = 164
      ExplicitTop = 12
    end
    inherited dynlblCreate_by: TcxLabel
      AnchorX = 221
    end
    inherited dynlblCheck_by: TcxLabel
      AnchorX = 429
    end
    inherited dynlblFilid: TcxLabel
      AnchorX = 88
    end
    inherited dynlblDeptid: TcxLabel
      AnchorX = 301
    end
    inherited dynlblEmpid: TcxLabel
      AnchorX = 505
    end
    inherited dynlblBKind: TcxLabel
      AnchorX = 149
    end
  end
  inherited MainDataSource: TDataSource
    Left = 221
    Top = 173
  end
  inherited PopupMenu1: TPopupMenu
    Left = 356
    Top = 92
  end
  inherited pmExec: TPopupMenu
    Top = 77
    object muDepotAnalyse: TMenuItem [4]
      Caption = #24211#23384#20998#26512
      Visible = False
      OnClick = muDepotAnalyseClick
    end
    object muCloudDownload: TMenuItem
      Caption = #20174#20113#35746#21333#19979#36733#35746#21333
      OnClick = muCloudDownloadClick
    end
  end
  inherited cxStyleRepository1: TcxStyleRepository
    PixelsPerInch = 96
    inherited cxGridBandedTableViewStyleSheet1: TcxGridBandedTableViewStyleSheet
      BuiltIn = True
    end
  end
  inherited cdsMaster: TClientDataSet
    object cdsMasterbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsMasterbkind: TIntegerField
      FieldName = 'bkind'
    end
    object cdsMasterbstate: TIntegerField
      FieldName = 'bstate'
    end
    object cdsMasterbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object cdsMasterbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object cdsMastertraderid: TIntegerField
      FieldName = 'traderid'
    end
    object cdsMasterfilid: TIntegerField
      FieldName = 'filid'
    end
    object cdsMasterdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object cdsMasterbalanceid: TIntegerField
      FieldName = 'balanceid'
    end
    object cdsMasteraccountid: TIntegerField
      FieldName = 'accountid'
    end
    object cdsMastercreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object cdsMastercheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object cdsMasterempid: TIntegerField
      FieldName = 'empid'
    end
    object cdsMastervoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object cdsMasterrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsMasteramount: TFloatField
      FieldName = 'amount'
    end
    object cdsMasterrelationamt: TFloatField
      FieldName = 'relationamt'
    end
    object cdsMastertransporttype: TIntegerField
      FieldName = 'transporttype'
    end
    object cdsMastercontactphone: TStringField
      FieldName = 'contactphone'
      Size = 40
    end
    object cdsMasterorderer: TStringField
      FieldName = 'orderer'
      Size = 60
    end
    object cdsMastercontractno: TStringField
      FieldName = 'contractno'
      Size = 40
    end
    object cdsMasterrevdate: TDateTimeField
      FieldName = 'revdate'
    end
    object cdsMastertargetaddr: TStringField
      FieldName = 'targetaddr'
      Size = 200
    end
    object cdsMasterpause: TBooleanField
      FieldName = 'pause'
    end
    object cdsMastercustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsMastercustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsMastercustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsMastercustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsMastercustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsMastercustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsMastercustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsMastercustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsMastercustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsMastercustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsMasterupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object cdsMasterremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object cdsMastercontacter: TStringField
      FieldName = 'contacter'
      Size = 60
    end
    object cdsMastercontactfax: TStringField
      FieldName = 'contactfax'
      Size = 40
    end
    object cdsMasterforwardamt: TFloatField
      FieldName = 'forwardamt'
    end
    object cdsMasterfinished: TBooleanField
      FieldName = 'finished'
    end
    object cdsMastercreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cdsMastercheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object cdsMastercustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsMastercustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsMastercustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsMastercustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsMastercustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsMastermoneyid: TIntegerField
      FieldName = 'moneyid'
    end
    object cdsMasterexchrate: TFloatField
      FieldName = 'exchrate'
    end
    object cdsMasterdcamount: TFloatField
      FieldName = 'dcamount'
    end
    object cdsMasterdcrelationamt: TFloatField
      FieldName = 'dcrelationamt'
    end
    object cdsMasterdcforwardamt: TFloatField
      FieldName = 'dcforwardamt'
    end
    object cdsMasterscamt: TFloatField
      FieldName = 'scamt'
    end
    object cdsMasteriscash: TBooleanField
      FieldName = 'iscash'
    end
    object cdsMastert_code: TWideStringField
      FieldName = 't_code'
      Size = 50
    end
    object cdsMastert_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object cdsMastermoneyname: TStringField
      FieldName = 'moneyname'
      Size = 60
    end
    object cdsMasterareacode: TWideStringField
      FieldName = 'areacode'
      Size = 50
    end
    object cdsMasterareaname: TWideStringField
      FieldName = 'areaname'
      Size = 60
    end
    object cdsMastervouchercode: TStringField
      FieldName = 'vouchercode'
      Size = 71
    end
    object cdsMastertermdays: TIntegerField
      FieldName = 'termdays'
    end
    object cdsMasterprojectid: TIntegerField
      FieldName = 'projectid'
    end
    object cdsMasterpjcode: TWideStringField
      FieldName = 'pjcode'
      Size = 40
    end
    object cdsMasterpjname: TWideStringField
      FieldName = 'pjname'
      Size = 60
    end
  end
  inherited qryDetail: TUniQuery
    SQL.Strings = (
      
        'select d.*,cast(dbo.f_getallqty(d.productid,unit1qty,unit2qty,un' +
        'it3qty) as varchar(30)) as Allqty '
      
        '     ,dbo.f_getrelationbcode(d.relationbtype,d.relationbid) as r' +
        'elationbcode'
      
        '     ,round((d.price*(1+d.taxrate/100)/(d.disc/100))*(1-d.disc/1' +
        '00)*d.quantity,2) as discamt'
      
        '     ,p.kind p_kind,p.code p_code, p.name p_name, p.spec p_spec,' +
        ' p.abname p_abname'
      
        '     ,p.custom1 p_custom1, p.custom2 p_custom2, p.custom3 p_cust' +
        'om3, p.custom4 p_custom4, p.custom5 p_custom5 '
      
        '     ,p.custom6 p_custom6, p.custom7 p_custom7, p.custom8 p_cust' +
        'om8, p.custom9 p_custom9, p.custom10 p_custom10 '
      
        '     ,p.producttypeid, p.producttrademarkid,p.quantity bookqty,p' +
        '.factqty,p.calccost p_calc,p.batch p_batch'
      
        '     ,dt.code depotcode, dt.name depotname, v.name bomname, v.co' +
        'de bomcode '
      
        '     ,u.barcode, u.unitname, u.rate unitrate,  t.unitname as bas' +
        'eunitname,l.unitname as unitassname '
      '    ,k.kname periodexecname'
      '    ,pic.pic as productpic'
      '     from tb_saleorderdtl d'
      '     left join td_product p on d.productid=p.p_id'
      '     left join td_productbomver v on d.bomid=v.bomid'
      '     left join td_depot dt on d.depotid=dt.depotid'
      '     left join td_unitprice u on d.unitid=u.unitid'
      
        '     left join td_unitprice t on (d.productid=t.productid and t.' +
        'baseunit=1)   '
      
        '     left join td_unitprice l on (d.productid=l.productid and l.' +
        'u_no=0)       '
      '     left join ts_kind k on k.kind=8000 and d.periodexec=k.kid'
      
        '     left join td_productpic pic on d.productid=pic.productid an' +
        'd pic.defpic=1'
      '     where bid=9356 order by d.borderno')
    Left = 228
    Top = 308
  end
  inherited MainDataSet: TUniQuery
    SQL.Strings = (
      'select top 1 m.*, t.scamt,t.iscash,t.code t_code,t.name t_name, '
      '     n.name moneyname,a.code areacode,a.name areaname,'
      
        '     ct.name + '#39' '#39' + cast(aa.voucherno as varchar(10)) as vouche' +
        'rcode '
      '     from tb_saleorder m '
      '     left join tfb_voucher aa on (aa.voucherid=m.voucherid)'
      '     left join tfd_vouword ct on (ct.id=aa.vouwordid)'
      '     left join td_trader t on m.traderid=t.traderid'
      '     left join td_area a on t.areaid=a.id'
      '     left join td_money n on m.moneyid=n.moneyid'
      '     where 1=1')
    object MainDataSetbid: TIntegerField
      FieldName = 'bid'
    end
    object MainDataSetbkind: TIntegerField
      FieldName = 'bkind'
    end
    object MainDataSetbstate: TIntegerField
      FieldName = 'bstate'
    end
    object MainDataSetbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object MainDataSetbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object MainDataSettraderid: TIntegerField
      FieldName = 'traderid'
    end
    object MainDataSetfilid: TIntegerField
      FieldName = 'filid'
    end
    object MainDataSetdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object MainDataSetbalanceid: TIntegerField
      FieldName = 'balanceid'
    end
    object MainDataSetaccountid: TIntegerField
      FieldName = 'accountid'
    end
    object MainDataSetcreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object MainDataSetcheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object MainDataSetempid: TIntegerField
      FieldName = 'empid'
    end
    object MainDataSetvoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object MainDataSetrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object MainDataSetamount: TFloatField
      FieldName = 'amount'
    end
    object MainDataSetrelationamt: TFloatField
      FieldName = 'relationamt'
    end
    object MainDataSettransporttype: TIntegerField
      FieldName = 'transporttype'
    end
    object MainDataSetcontactphone: TStringField
      FieldName = 'contactphone'
      Size = 40
    end
    object MainDataSetorderer: TStringField
      FieldName = 'orderer'
      Size = 60
    end
    object MainDataSetcontractno: TStringField
      FieldName = 'contractno'
      Size = 40
    end
    object MainDataSetrevdate: TDateTimeField
      FieldName = 'revdate'
    end
    object MainDataSettargetaddr: TStringField
      FieldName = 'targetaddr'
      Size = 200
    end
    object MainDataSetpause: TBooleanField
      FieldName = 'pause'
    end
    object MainDataSetcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object MainDataSetcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object MainDataSetcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object MainDataSetcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object MainDataSetcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object MainDataSetcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object MainDataSetcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object MainDataSetcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object MainDataSetcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object MainDataSetcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object MainDataSetupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object MainDataSetremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object MainDataSetcontacter: TStringField
      FieldName = 'contacter'
      Size = 60
    end
    object MainDataSetcontactfax: TStringField
      FieldName = 'contactfax'
      Size = 40
    end
    object MainDataSetforwardamt: TFloatField
      FieldName = 'forwardamt'
    end
    object MainDataSetfinished: TBooleanField
      FieldName = 'finished'
    end
    object MainDataSetcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object MainDataSetcheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object MainDataSetcustom11: TFloatField
      FieldName = 'custom11'
    end
    object MainDataSetcustom12: TFloatField
      FieldName = 'custom12'
    end
    object MainDataSetcustom13: TFloatField
      FieldName = 'custom13'
    end
    object MainDataSetcustom14: TFloatField
      FieldName = 'custom14'
    end
    object MainDataSetcustom15: TFloatField
      FieldName = 'custom15'
    end
    object MainDataSetmoneyid: TIntegerField
      FieldName = 'moneyid'
    end
    object MainDataSetexchrate: TFloatField
      FieldName = 'exchrate'
    end
    object MainDataSetdcamount: TFloatField
      FieldName = 'dcamount'
    end
    object MainDataSetdcrelationamt: TFloatField
      FieldName = 'dcrelationamt'
    end
    object MainDataSetdcforwardamt: TFloatField
      FieldName = 'dcforwardamt'
    end
    object MainDataSetscamt: TFloatField
      FieldName = 'scamt'
    end
    object MainDataSetiscash: TBooleanField
      FieldName = 'iscash'
    end
    object MainDataSett_code: TWideStringField
      FieldName = 't_code'
      Size = 50
    end
    object MainDataSett_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object MainDataSetmoneyname: TStringField
      FieldName = 'moneyname'
      Size = 60
    end
    object MainDataSetareacode: TWideStringField
      FieldName = 'areacode'
      Size = 50
    end
    object MainDataSetareaname: TWideStringField
      FieldName = 'areaname'
      Size = 60
    end
    object MainDataSetvouchercode: TStringField
      FieldName = 'vouchercode'
      Size = 71
    end
    object MainDataSettermdays: TIntegerField
      FieldName = 'termdays'
    end
    object MainDataSetprojectid: TIntegerField
      FieldName = 'projectid'
    end
    object MainDataSetpjcode: TWideStringField
      FieldName = 'pjcode'
      Size = 40
    end
    object MainDataSetpjname: TWideStringField
      FieldName = 'pjname'
      Size = 60
    end
  end
end
